import {request} from '@/utils/request'
import type {PageParams, EmployeeResult, AddEmployeeParams, RootObject} from '@/types/employee.d.ts'


// 获取员工列表
export const getEmployeeListApi = (params: PageParams) => {
  return request<EmployeeResult>('/sys/user', 'get', params)
}

// 获取员工详情 -- 基本信息
export const getEmployeeDetailApi = (id: string) => {
  return request<RootObject>('/sys/user/' + id, 'get')
}

// 新增员工
export const addEmployeeApi = (data: AddEmployeeParams) => {
  return request('/sys/user', 'post', data)
}

// 删除员工
export const deleteEmployeeApi = (id: string) => {
  return request('/sys/user/' + id, 'delete')
}


